From 8d11e2013f34c132174532aeae903ff1fcc15450 Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 18 Mar 2005 19:20:31 +0000 Subject: [PATCH] Don't leak on non-uniq blank names. Don't read past beginning of string on blank names after blank whacking applied. --- gpsbabel/mkshort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpsbabel/mkshort.c b/gpsbabel/mkshort.c index 48ab322d8..1efcb7812 100644 --- a/gpsbabel/mkshort.c +++ b/gpsbabel/mkshort.c @@ -387,7 +387,7 @@ mkshort(void *h, const char *istring) * Walk in the Woods 2. */ np = ostring + strlen(ostring); - while (isdigit(*(np-1) )) { + while (*np && isdigit(*(np-1) )) { np--; } if (np) { @@ -407,6 +407,7 @@ mkshort(void *h, const char *istring) * let the must_uniq code handle it. */ if (ostring[0] == '\0') { + xfree(ostring); ostring = xstrdup("WPT"); } -- 2.30.2